<template>
  <van-nav-bar
      fixed
      title="资讯列表"
      left-text="返回"
      left-arrow
      @click-left="onClickLeft"
  />
  <van-divider></van-divider>
  <van-divider></van-divider>
  <div v-for="item in list" :key="item">
   <van-cell :title="item.title" :label="item.short_content" @click="article(item.id)"/>
    <van-divider />
  </div>
  <van-pagination v-model="currentPage" :total-items="total" :items-per-page="15" @change="pageClick"/>
  <van-divider></van-divider>
</template>
<script>
import {articleList} from "@/api/article";

export default {
  name: "ArticleList",
  data(){
    return {
      list:{},
      page:1,
      currentPage:1
    }
  },
  created() {
    articleList(this.page).then((res)=>{
      this.list = res.data.data
    })
  },
  methods:{
    article(id){
      this.$router.push("/article?id="+id)
    },
      onClickLeft(){
        history.back()
      },

  }
}
</script>

<style scoped>

</style>
